#include "windpan.h"

windPan::windPan(QWidget *parent) : QWidget(parent)
{

}

windPan::windPan(int maxFloor)
{
    setFixedSize(800,600);
    setWindowTitle("风之罗盘");

    label=new QLabel(this);
    label->setText("楼层跳跃");
    ConPB=new QPushButton("确定");

    floorList=new QListWidget(this);
    for(int i=1;i<=maxFloor;i++){
        floorList->addItem("第"+QString::number(i,10)+"层");
    }

    QVBoxLayout *pMain=new QVBoxLayout;
    pMain->addWidget(label);
    pMain->addWidget(floorList);
    pMain->addWidget(ConPB);

    setLayout(pMain);

    connect(ConPB,SIGNAL(clicked(bool)),this,SLOT(change()));
}

void windPan::change()
{
    this->hide();
    emit sendId(floorList->currentRow()+1);
}


